#pragma once

#include<iostream>
#include<unistd.h>
#include<cstring>
#include<fcntl.h>
#include<functional>


void setNoBlock(int fd)
{
    int fl = fcntl(fd,F_GETFL);
    if(fl == -1)
    {
        std::cerr << "fcntl: " << strerror(errno)<<std::endl;
        return;
    }
    fcntl(fd,F_SETFL,fl|O_NONBLOCK);
}

using func_t = std::function<void()>;

void printlog()
{
    std::cout << "this is a log" <<std::endl;
}

void download()
{
    std::cout << "this is a download" <<std::endl;
}

void executeSql()
{
    std::cout << "this is a executeSql" <<std::endl;
}